1. Field of the Invention
The present invention relates to a control method of memory storage device; in particular, to a control method for wear-leveling in the memory device.
2. Description of Related Art
Non-volatile memory storage devices using NAND-typed Flash memory as storage media provide advantages of small size, low power consumption, quietness in use and endurance against vibration and so forth, and at present they are commonly applied in hosts (e.g. various electronic devices) in a broad range of different forms. For example, they can be employed in network servers, notebook computers, hand-held MP3 music players, general desktop PC, digital cameras etc.
Refer first to FIG. 1, wherein a system architecture diagram for an embodiment of the conventional memory storage device is shown. As depicted in FIG. 1, the memory storage device 13 comprises a control unit 131 and a storage unit 133, in which the storage unit 133 is composed of Flash memories for data storage; the control unit 131 is coupled to the host 11 to receive the command issued from the host 11 for required operations, and to perform data access operations in accordance with the operations assigned by the received commands, thereby recording the data inputted by the host 11 to the storage unit 133 or, alternatively, reading from the storage unit 133 the data required by the host 11 and send it back.
The storage unit 133 consists of physical storage space formed by a plurality of physical blocks for data access, with each physical block increasing its own accumulated erase count because of the erase action taken after moving off the data originally stored therein; when the extent of wearing approaches to its useable life cycle, the reliability of data retention for data storage gradually deteriorates to a level unable to reliably recording data, finally leading to permanent failure in the storage device due to deterioration occurring in partial physical blocks of the storage device. As a result, in order to reduce the difference between the accumulated erase count of each respective physical block, it is necessary to balance each physical block through the wear-leveling technology so as to avoid overly use of certain portion of the physical blocks which may cause undesirable early termination of the life cycle, resulting in a situation that the storage device fails to reliably store correct data before other physical blocks are sufficiently employed.
Currently proposed wear-leveling technologies can be largely classified as dynamic wear-leveling and static wear-leveling. The dynamic wear-leveling is that, upon modification or update of the stored data recorded in the physical blocks, it selects among the erased physical blocks the one having lowest accumulated erase count to store the updated data. Since only the dynamic data whose contents have been updated or changed will be adjusted with regards to storage location thereof, it is therefore referred as dynamic wear-leveling technology.
On the other hand, the static wear-leveling is to start static wear-leveling operations when the difference between the highest and lowest accumulated erase counts reaches a prescribed threshold among the physical blocks allocated with data, even though the stored data recorded in such physical blocks has not been modified or updated. In the static wear-leveling operations, the controller will move the data in the physical block having the lowest accumulated erase count into the one having the highest accumulated erase count, and then erase the physical block having the lowest accumulated erase count. Thereby, it is possible to change the location of the physical block used by the static data, and release the physical block previously occupied in long term by the static data and accordingly having lower accumulated erase count, thus enabling its use by subsequent updated data, further achieving the effects of location adjustment in the physical block used by the static data and implementation of static wear-leveling.
However, the aforementioned wear-leveling operations require huge amounts of time and resources to search the physical block with lower accumulated erase count, and the dynamic wear-leveling is simply addressed to the blocks having updated data for wear-leveling, thus the defect of uneven wear-leveling still exists. Therefore, how to improve the performance of wear-leveling has been one challenging issue for breakthrough in such a technical field.